# Contributor: Russ Webber <russ@rw.id.au>
# Maintainer: Russ Webber <russ@rw.id.au>
pkgname=log4cxx
pkgver=0.10.0
pkgrel=0
pkgdesc="A C++ port of the Log4j logging framework."
url="http://logging.apache.org/log4cxx"
license="Apache-2.0"
options="!check"  # testsuite in 0.10.0 does not work on alpine
subpackages="$pkgname-static $pkgname-dev"
arch="all"
depends_dev="$pkgname-static"
makedepends="autoconf automake libtool zip libxml2-dev apr-util-dev"
source="https://archive.apache.org/dist/logging/$pkgname/$pkgver/apache-$pkgname-$pkgver.tar.gz
        $pkgname-GPGKEYS::https://archive.apache.org/dist/logging/KEYS
        log4cxx-0.10.0-missing_includes.patch
        log4cxx-0.10.0-narrowing-fixes-from-upstream.patch"
builddir="$srcdir/apache-$pkgname-$pkgver"

prepare() {
  update_config_guess
  default_prepare
}

build() {
  # if configure is autogenerated make install seems to fail #./autogen.sh
  # does not configure if specifying --build=$CBUILD \ --host=$CHOST \
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --mandir=/usr/share/man \
    --localstatedir=/var

  make
}

check() {
  make check
}

package() {
  make DESTDIR="$pkgdir" install
}

# Used by: https://github.com/alpinelinux/abuild/pull/57
#gpg_signature_extensions="asc"
#gpgfingerprints="good:748F 15B2 CF9B A8F0 2415  5E6E D7C9 2B70 FA1C 814D"

sha512sums="1c34d80983db5648bc4582ddcf6b4fdefdc6594c2769f95235f5441cd6d03cf279cc8f365e9a687085b113f79ebac9d7d33a54b6aa3b3b808c0e1a56a15ffa37  apache-log4cxx-0.10.0.tar.gz
3e380b6633cce6f31447c0a6448685d927cb91d8184692d4e420865f5bfc67379e2ae97a7db2c2ad51b543123440827e0d092e84cfdbc8b3652e92d97e08115a  log4cxx-GPGKEYS
14fa0b19516171cbbe2c6220816819fc52cf8f3b3ded5d71966e2f4a71bda9ce1ed8fe7e57745a835e6ac5558631916ed9824d09ec7469d84c7bf99fb4946304  log4cxx-0.10.0-missing_includes.patch
15b692b37961adbc808e4c10d2719483502f3ac060ee5be248832d4e2a2f76f7d9e120ea9a6bf908230cf230a893964040e54415cca35a12e576d0a5ab1f4176  log4cxx-0.10.0-narrowing-fixes-from-upstream.patch"
